<?xml version="1.0" encoding="${encoding}" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Imagebrowser</title>

<script src="../../js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="../../js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>
<script src="../../js/jqueryplugins/jqModal/jqModal.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../../js/jqueryplugins/jqModal/jqModal.css"/>

<script src="widget.imagebrowser.js" type="text/javascript"></script>
</head>
<body>
	<h2>image browser widget test</h2>
    	<span id="ibtest"></span>
        <script>
	        jQuery(document).ready(function(){
	
	            jQuery('#ibtest').imagebrowser({initCallback: imagebrowserLoaded});
	              
	        });
	        function imagebrowserLoaded(hash){
				if(hash.status==0){
					var buttonHtml = '<a href="javascript:imagebrowser(function(h){alert(h.uri);});">Select an image</a>'
					jQuery("#button").html(buttonHtml);
				}else{
					jQuery("#button").html("imagebrowser initialisation error ("+ hash.errorMsg + ")");
				}
	        }
        </script>
        <div id="button"></div>
        
</body>
</html>